﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Site.Models.Message>>" %>

<table>
    <tr>
        <th>
            De
        </th>
        <th>
            Sujet
        </th>
        <th>
            Message
        </th>
        <th>
            Date d'envoi
        </th>
        <th>
        </th>
    </tr>
    <% foreach (var item in Model)
       { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.Sender) %>
        </td>
        <td>
            <%: Html.ActionLink(item.Subject, "ReadMessage", new { id= item.MessageId})%>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Body) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.SentDate) %>
        </td>
        <td>
            <%: Html.ActionLink("Supprimer", "Delete", new { id=item.MessageId }) %>
        </td>
    </tr>
    <% } %>
</table>
